Add dispatch open --stdin to batch resume sessions from piped IDs#311
Merged
Conversation
Resume many sessions in one shot by piping IDs into `open --stdin`, one per line. Composes with any command that emits session IDs, such as `search --ids`. Blank and `#` comment lines are skipped, only the first field of each line is read, and duplicate IDs are dropped while preserving order. Each ID is alias-resolved like single-session open. Batch resume needs an explicit launch target (`--mode tab|window|pane`) or `--print`, since inplace launch cannot host multiple sessions. A missing or unresumable ID does not abort the run: the rest resume, a `resumed N of M sessions` summary prints, and the command exits with an aggregated error. `--stdin` is rejected alongside a positional ID or `--last`. Also drains the stdout pipe on a goroutine in TestPrintUsage_Output so the grown usage banner cannot deadlock on the Windows pipe buffer. Closes #310 Co-authored-by: Copilot App <[email protected]>
# Conflicts: # cmd/dispatch/main_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
dispatch open --stdinto resume many sessions at once from IDs piped on standard input, one per line.What changed
open --stdinreads session IDs from standard input and resumes each valid one.#comments, takes the first field of each line, and drops duplicates while preserving order.open.--mode tab|window|paneor--print; inplace launch is rejected because it cannot host multiple sessions.--stdin --printprints the resume command per session instead of launching.resumed N of M sessionssummary, and exit non-zero with an aggregated error.--stdinis mutually exclusive with a positional ID and with--last.Testing
go build ./...,go vet ./...,go test ./... -count=1all green.golangci-lint runreports 0 issues;mage deadcodeOK.--print.Also drains the stdout pipe on a goroutine in
TestPrintUsage_Outputso the grown usage banner cannot deadlock on the smaller Windows pipe buffer.Closes #310